<template>
  <!-- <nav>
    <router-link to="/">Home</router-link> |
    <router-link to="/about">About</router-link>
    <el-button type="primary" @click="text">确定</el-button>
  </nav> -->
  <router-view/>
</template>
<script lang="ts">
import { defineComponent, getCurrentInstance, ComponentPublicInstance } from 'vue'
import Axios from 'axios';
import { doLogin as loginApi } from '@/api/user';
export default defineComponent({
  setup(){
    const instance = getCurrentInstance()
    const proxy = instance?.proxy as ComponentPublicInstance
    window.a = 1;
    console.log(proxy.$abc, 'proxy.$abc');
    console.log(window.a, 'window.a');
    const text= async ()=>{
      // const res= await Axios.post('/api/login')
      const res= await loginApi({ account: '1', password: '2' })
      //AxiosPromise =>  res.data
      // IResData => data + code
      // IUserData => token
      res.data.data.token
    }
    return {
      text
    }
  }
})
</script>

<style lang="scss">
</style>
